User forums > Using Code::Blocks

CodeBlocks, VC-Tools2003 and SDL

(1/3) > >>

atom:
hi,
i was quite happy to find an ide like codeblocks and was desperate to do some little project, just to use it. i am embarrassed to admit: i can't get it to compile and link!

i had various error messages, ranging between "unresolved symbol" and "missing entry point" and i'm totally lost. can anybody help me and document a setup for this on windows?


thanks a lot in advance!
atom

mandrav:
For installation info look at the wiki, under "Articles".
If you 're still having problems, don't be afraid to ask here. Just be more specific...

Yiannis.

Anonymous:
I'll post to this thread, as it seems to be almost the same, and the 'Articles' do not yet address this issue.  I've installed VC-Tools 2003, WinXP SDK, and Code::Blocks 1.0 Beta 5.  Created new 'Win32 GUI Application" in Code::Blocks, and did not modify the auto-generated code.  Pointed the 'Project' -> 'Build Options' -> 'Compiler dirs' to the SDK include subdirectory, and the 'Project' -> 'Build Options' -> 'Linker dirs' to the SDK Lib subdirectory.  Upon pressing compile, get the following errors:

Linking executable: D:\Temp\Test.exe
LINK : warning LNK4044: unrecognized option '/lstdc++'; ignored
LINK : warning LNK4044: unrecognized option '/lgcc'; ignored
LINK : warning LNK4044: unrecognized option '/lgdi32'; ignored
LINK : warning LNK4044: unrecognized option '/lcomdlg32'; ignored
LINK : warning LNK4044: unrecognized option '/lodbc32'; ignored
LINK : warning LNK4044: unrecognized option '/lwsock32'; ignored
LINK : warning LNK4044: unrecognized option '/lwinspool'; ignored
LINK : warning LNK4044: unrecognized option '/lwinmm'; ignored
LINK : warning LNK4044: unrecognized option '/lshell32'; ignored
LINK : warning LNK4044: unrecognized option '/lcomctl32'; ignored
LINK : warning LNK4044: unrecognized option '/lctl3d32'; ignored
LINK : warning LNK4044: unrecognized option '/ladvapi32'; ignored
LINK : warning LNK4044: unrecognized option '/lopengl32'; ignored
LINK : warning LNK4044: unrecognized option '/lglu32'; ignored
LINK : warning LNK4044: unrecognized option '/lole32'; ignored
LINK : warning LNK4044: unrecognized option '/loleaut32'; ignored
LINK : warning LNK4044: unrecognized option '/luuid'; ignored
main.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__GetMessageA@16 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__RegisterClassExA@4 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "long __stdcall WindowProcedure(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z)
main.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall WindowProcedure(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z)
D:\\Temp\\Test.exe : fatal error LNK1120: 10 unresolved externals
Process terminated with status 1 (0 minutes, 0 seconds)
11 errors, 0 warnings

I got rid of the "This is a custom Makefile" checkmark in the project Properties box.  (Also tried it with it checked.  Same problem.)

What is the next step?

Oh - and now the 'Project' -> 'Build Options' menu item won't bring up the options window...
(Maybe it never did, but I thought it did.  I can get what I believe is the right window by clicking on 'Project' -> 'Properties' -> 'Targets' tab, and then clicking on the 'Target's Build Options' button.)

Thanks,
David

Anonymous:
I just found an answer in another thread ("Lib files not found with VC++ Toolkit") - Seems to have fixed most of it.  The program compiles and runs, although I still get the following warnings when I press the compile button:

Calculating dependencies: main.cpp
Switching to target: default
main.cpp
Linking executable: test.exe
LINK : warning LNK4044: unrecognized option '/lstdc++'; ignored
LINK : warning LNK4044: unrecognized option '/lgcc'; ignored
LINK : warning LNK4044: unrecognized option '/lgdi32'; ignored
LINK : warning LNK4044: unrecognized option '/lcomdlg32'; ignored
LINK : warning LNK4044: unrecognized option '/lodbc32'; ignored
LINK : warning LNK4044: unrecognized option '/lwsock32'; ignored
LINK : warning LNK4044: unrecognized option '/lwinspool'; ignored
LINK : warning LNK4044: unrecognized option '/lwinmm'; ignored
LINK : warning LNK4044: unrecognized option '/lshell32'; ignored
LINK : warning LNK4044: unrecognized option '/lcomctl32'; ignored
LINK : warning LNK4044: unrecognized option '/lctl3d32'; ignored
LINK : warning LNK4044: unrecognized option '/ladvapi32'; ignored
LINK : warning LNK4044: unrecognized option '/lopengl32'; ignored
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

What do I need to do to get rid of these?  (Edit the .cpb file manually?  Where are they coming from in Code::Blocks?  I can't find them except in the .cpb.)

Thanks,
David

mandrav:

--- Quote ---Oh - and now the 'Project' -> 'Build Options' menu item won't bring up the options window...
(Maybe it never did, but I thought it did. I can get what I believe is the right window by clicking on 'Project' -> 'Properties' -> 'Targets' tab, and then clicking on the 'Target's Build Options' button.)
--- End quote ---

This is a known bug in beta5. You first have to select the project in the tree and then the menu "Project/Build options" will work. Alternatively, right-click the project in the tree and select "Build options"...

In the build options window, go to the linker options tab and remove the "/l" from the above options that give you errors (you might as well append ".lib" to each of the above).

HTH,
Yiannis.

Navigation

[0] Message Index

[#] Next page

Go to full version