I'm trying to use the _outp functions that are part of MSVCRT, but the linker gives me a "undefined reference message" and thats only if I put a function prototype in, otherwise the compiler just tells me it doesnt recognise the function at all.
The MS site indicates you need to include <conio.h> and I know there are issues with this. I've tried the workaround (ie including conio.c etc) with no luck, and anyway _outp isnt declared in conio.h...
More strangely (to me anyway), in a very similar file compiled as a DLL, there doenst seem to be a problem... (havent used the dll yet though)
I'm confused, but then I'm not an expert (on this sort of thing)
Thanks
Tim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well thanks for the sarcasm, do you think I didnt try searching before I posted a message...?
Anyway, the question was about why it seemed to work when compiling a DLL rather than an exe, not just how to type "_outp(" into the code (I'd got that far myself). The *answer* seems to be related to whether or not the project is C or C++. Initially I was unable to replicate the problem, the only way I managed to was by changing the 'compile as C++' options in the Project Options dialogue...
I can only think that my DLL project was correctly set up as a C project, whereas the exe one I'd set up as a C++ project unintentionally.
So if anyone else has this problem, then thats your first place to look...
Tim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No sarcasm was intended Tim. The reason Igave directions to the search box is that a large number of folks that I give such directions indicate soemthing along the lines of "I didn't know that was there!"
"do you think I didnt try searching before I posted a message...?"
How would I know? You gave no indication that you had. Most folks don't.
I'm glad you found you answer and documented it...
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use the _outp functions that are part of MSVCRT, but the linker gives me a "undefined reference message" and thats only if I put a function prototype in, otherwise the compiler just tells me it doesnt recognise the function at all.
The MS site indicates you need to include <conio.h> and I know there are issues with this. I've tried the workaround (ie including conio.c etc) with no luck, and anyway _outp isnt declared in conio.h...
More strangely (to me anyway), in a very similar file compiled as a DLL, there doenst seem to be a problem... (havent used the dll yet though)
I'm confused, but then I'm not an expert (on this sort of thing)
Thanks
Tim
Do a forum search in the bloodshed forum (this is really not a support forum, it is a developer forum), this topic has been discussed before.
Search is started by little box in the upper left, button labled "search"...be patient, it takes time..
Wayne
Well thanks for the sarcasm, do you think I didnt try searching before I posted a message...?
Anyway, the question was about why it seemed to work when compiling a DLL rather than an exe, not just how to type "_outp(" into the code (I'd got that far myself). The *answer* seems to be related to whether or not the project is C or C++. Initially I was unable to replicate the problem, the only way I managed to was by changing the 'compile as C++' options in the Project Options dialogue...
I can only think that my DLL project was correctly set up as a C project, whereas the exe one I'd set up as a C++ project unintentionally.
So if anyone else has this problem, then thats your first place to look...
Tim
No sarcasm was intended Tim. The reason Igave directions to the search box is that a large number of folks that I give such directions indicate soemthing along the lines of "I didn't know that was there!"
"do you think I didnt try searching before I posted a message...?"
How would I know? You gave no indication that you had. Most folks don't.
I'm glad you found you answer and documented it...
Wayne