Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Okay, I have to understand this whole module thing... (C)
#21
Zack thats a single module.
Reply
#22
*Reads up*
Oh...sorry, didn't notice that you were using multimodules...never mind my post.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#23
Zack it would be better if you used "" instead of the <>.
Reply
#24
Yeah...I noticed that in a few books, but they never explained.
Care to do so?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#25
The only reason is that "" tells the compiler to search for the file in the current directory while <> tells the compiler to search it all over the place. So if you have multiple iostreams and use <> then it will confuse the compiler while "" wont as it will search only in the current directory.
Reply
#26
Ooh, gotcha. But I have stdio.h in a DJGPP directory, and the Mingw32 directory, and #include <stdio.h> works fine.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#27
On the <> over "" thing. Zack is right in this case.

I cant find the documentaion on this right now, but i know ive read it.

Anyways to summarize: it is reccomended useing <> since allegro's make automatically inserts the allegro headers in your compilers directory, and it saves the compiler from searching more. Allegro's programs only use "" BECAUSE they are compiled BEFORE the includes are moved. Also several times on the allegro boards ive seen reccomendations of <>

Ill admit i personally use "", but only to differentiate between standard includes and libraries.

Quote:The only reason is that "" tells the compiler to search for the file in the current directory while <> tells the compiler to search it all over the place. So if you have multiple iostreams and use <> then it will confuse the compiler while "" wont as it will search only in the current directory.
No. "" tells the compiler to look for the file in the current directoy, and THEN all over the place. <> says to only look in the system directory. It will not look all over the place, nor will it confuse the compiler.



Quote:Mango, I am using the 4.9.8.0 version of DevC++. Dont use 4.0.4 version of allegro, upgrade it. I dunno whats the latest but I'm using 4.1.11

Ive said this before, 4.1.x is the development branch of allegro. It is not guaranteed to be stable, or comptaible with any other previosly released alleg41.dll. This is where functions are released to be tested BEFORE being released to the 4.0.x branch (the one mango is using). Therefore mango is using the latest version. Usage of 4.1.x is only required if there is some function that you absolutely need not supported under the 4.0.x branch.

Your Dev-C++ build on the other hand is outdated. Wink

TBQ, im not really sure what is going wrong on your end, but Dev-Cpp is known to work fine with mutliple modules. You can try:

a)Switching the order or your linking commands
b)Downgrading to the gcc compiler version of windows, version 2.95. However this does not support namespaces and its STL is borked.

Quote:testmod1.cpp: undefined reference to `install_allegro'
testmod1.cpp: undefined reference to `allegro_exit'
testmod1.cpp: undefined reference to `_WinMain'
Nathan pointed out your 3rd mistake, did you read his post?
Do you have END_OF_MAIN at the end of main? this is required for Windows. May not be on other platforms(which would explain why it works on other platforms, such as Linux or DOS)
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Reply
#28
Doesn't Mingw32 ONLY compile 32-bit apps? So you'll need END_OF_MAIN() at the end always.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#29
Quote:testmod1.cpp: undefined reference to `install_allegro'
testmod1.cpp: undefined reference to `allegro_exit'
testmod1.cpp: undefined reference to `_WinMain'

Sounds like you forgot to include liballeg.a

DevCpp Project->Project Options->Then it is something like external libraries...

Well I'm a C++ newbie and find the code hard to read, so I haven't
completed any program because of bugs Sad
/post]
Reply
#30
I am either braindead or I am not getting the message through to you guyz.

Quote:I dont think there is any kind of interference since single module programs compile without any problem.

Thats me. As you can see I am telling you that single modules work properly while using both libraries.

I havent forgotten to put END_OF_MAIN(); :roll:. Geez I have been using allegro for sometime now in single modules. I am not a total idiot =P. Also, I dont know if i've mentioned this (actually too lazy to scroll up and find my own post =P) but my friend compiled the same program using allegro in MSVC 7. So there isnt any problem with my code =).

red, you dont include liballeg.so you link it by using -lalleg while compiling.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)